package handler

import (
	"go-zero-example/cmd/userapi/internal/svc"
	"net/http"

	"github.com/zeromicro/go-zero/rest"
)

func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {

	server.AddRoutes(
		[]rest.Route{
			{
				Method:  http.MethodGet,
				Path:    "/from/:name",
				Handler: DemoHandler(serverCtx),
			},
		},
	)

	server.AddRoutes(
		[]rest.Route{
			{
				Method:  http.MethodPost,
				Path:    "/user/register",
				Handler: UserRegisterHandle(serverCtx),
			},
			{
				Method:  http.MethodGet,
				Path:    "/user/get_info",
				Handler: GetUserHandle(serverCtx),
			},
			{
				Method:  http.MethodPost,
				Path:    "/user/re_phone",
				Handler: UserRePhoneHandle(serverCtx),
			},
		},
	)

}
